﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace RTS_RPG
{
    public class Area_TextureManager
    {
        public static short AREA_CHARACTER_SIZE = 50;
        public static short HALF_CHARACTER_SIZE = 25;

        #region TEXTURE_SECTION
        /*********************/
        public Texture2D character_main         { get; private set; }
        public Texture2D block_a                { get; private set; }
        public Texture2D unit_default_image     { get; private set; }
        public Texture2D unit_default_attack    { get; private set; }
        public Texture2D unit_default_avatar    { get; private set; }
        public Texture2D keys_up                { get; private set; }
        public Texture2D keys_down              { get; private set; }
        public Texture2D keys_shift             { get; private set; }
        public Texture2D keys_ctrl              { get; private set; }
        public Texture2D keys_space             { get; private set; }
        public Texture2D mouse                  { get; private set; }
        public Texture2D blankBoxSmall          { get; private set; }
        /*********************/
        #endregion
        public SpriteFont font;
        public SpriteFont font2;

        public IServiceProvider services;
        public ContentManager area_textures;

        public Area_TextureManager(IServiceProvider s)
        {
            services = s;
            font = null;
            font2 = null;

            character_main          = null;
            block_a                 = null;

            unit_default_image      = null;
            unit_default_attack     = null;
            unit_default_avatar     = null;
            keys_up                 = null;
            keys_down               = null;
            keys_shift              = null;
            keys_ctrl               = null;
            keys_space              = null;
            mouse                   = null;
            blankBoxSmall           = null;
        }

        public void LoadAreaContent()
        {
            area_textures = new ContentManager(services);
            area_textures.RootDirectory = "Content";
            font                = area_textures.Load<SpriteFont>("Shared/Fonts/font1");
            font2               = area_textures.Load<SpriteFont>("Shared/Fonts/font2");

            character_main      = area_textures.Load<Texture2D>("Area/Area_Sprite");
            block_a             = area_textures.Load<Texture2D>("Area/Block_One");

            mouse               = area_textures.Load<Texture2D>("Shared/Mouse");
            unit_default_avatar = area_textures.Load<Texture2D>("Shared/Basic_Avatar");

            unit_default_image  = area_textures.Load<Texture2D>("Battle/Basic_Unit");
            blankBoxSmall       = area_textures.Load<Texture2D>("Battle/Select");
            keys_up             = area_textures.Load<Texture2D>("Battle/Keys/UpKey");
            keys_down           = area_textures.Load<Texture2D>("Battle/Keys/DownKey");
            keys_shift          = area_textures.Load<Texture2D>("Battle/Keys/ShiftKey");
            keys_ctrl           = area_textures.Load<Texture2D>("Battle/Keys/CtrlKey");
            keys_space          = area_textures.Load<Texture2D>("Battle/Keys/SpaceKey");
            blankBoxSmall       = area_textures.Load<Texture2D>("Battle/Select");
        }

        public void UnloadAreaContent()
        {
            area_textures.Unload();
        }
    }
}
